﻿/**
 * 
 * Copyright 2009, 2010 Mike Jamer [email: mikejamer@gmail.com ]
 * 
 * This File is part of Moose IRC
 * 
 * MooseIRC is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * MooseIRC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with MooseIRC.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MooseIRC.Client.Server {
    
    /// <summary>
    /// Channel Server, manages multiple channels for Sessions
    /// </summary>
    internal class ChannelServer : Server {

        /// <summary>
        /// Collection of connected clients
        /// </summary>
        private List<ChannelClient> m_connected_clients;

        /// <summary>
        /// Initialize Channel Server
        /// </summary>
        public ChannelServer() : base() {
            m_connected_clients = new List<ChannelClient>();
            return;
        }

        /// <summary>
        /// Fires when a channel connects
        /// </summary>
        /// <param name="result">Async. Result</param>
        protected override void onAcceptComplete(IAsyncResult result) {
            //ChannelClient client = new ChannelClient( m_socket_listener.EndAccept(result),  )

            /**
             * the connection portion here has to be two stage, see, we need to register this with an entity, 
             * 
             */
            m_socket_listener.BeginAccept(onAcceptComplete, null);
            return;
        }

        

    }
}
